import request from '@/utils/request'

// 获取员工列表信息
// data: { page, size }
export const getEmployees = function(data) {
  return request.get('/sys/user', { params: data })
}
// 删除员工信息
export const delEmployees = function(id) {
  return request.delete(`/sys/user/${id}` )
}
// 添加新员工
export function addEmployee(data) {
  request.post('/sys/user', data)
}

export function importEmployee(data) {
  return request({
    url: '/sys/user/batch',
    method: 'post',
    data
  })
}
// 更新员工信息
export function saveUserDetailById(data) {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'put', // 全量修改
    data
  })
}
// 为当前用户分配角色
export function assignRoles(data) {
  return request({
    url: '/sys/user/assignRoles',
    data,
    method: 'put'
  })
}